#pragma once

// base classes
#include "API/TESForms/TESForm.h" // TESFormIDListView
#include "API/TESForms/BaseFormComponent.h" // additonal form components
#include "Components/ExtendedForm.h"

// Macros for short name and class name, which must be unique among all plugins, and just this plugin, respectively
#define AFFIXLIST_SHORTNAME "DWAL"
#define AFFIXLIST_CLASSNAME "AffixList" 

// AffixList - new form class definition
class AffixList :  public TESFormIDListView {
public:

    // members
    //     /*00/00*/ TESForm				// 18/24
	MEMBER /*18/24*/ bool onSelf;

	MEMBER /*19/25*/ bool noVars;

	MEMBER /*1A/26*/ UInt16 minUses;
	MEMBER /*1C/28*/ UInt16 maxUses;
	MEMBER /*1E/2A*/ float noDurChance;
	MEMBER /*22/2E*/ float minMagPct;
	MEMBER /*26/32*/ float minDurPct;

	MEMBER /*2A/36*/ float rank;
	MEMBER /*2E/3A*/ float freq;

	MEMBER /*32/3E*/ UInt8			souls;
    MEMBER /*33/3F*/ BSStringT		sub;
	MEMBER /*3B/37*/ BSStringT		pet;
	MEMBER /*43/4F*/ BSStringT		les;
	MEMBER /*4B/47*/ BSStringT		com;
	MEMBER /*53/5F*/ BSStringT		grt;
	MEMBER /*5B/57*/ BSStringT		gnd;
	MEMBER /*63/6F*/ BSStringT		ult;
    //       6B/77 <-- total object size

    // TESFormIDListView virtual method overrides
    // Note the use of the '_LOCAL' macro to indicate that these functions are being (re)implemented by this plugin
    _LOCAL /*010/034*/ virtual              ~AffixList();
    _LOCAL /*01C/040*/ virtual bool         LoadForm(TESFile& file);
    _LOCAL /*024/048*/ virtual void         SaveFormChunks();
    _LOCAL /*070/074*/ virtual UInt8        GetFormType();
    _LOCAL /*0B4/0B8*/ virtual void         CopyFrom(TESForm& form);
    _LOCAL /*0B8/0BC*/ virtual bool         CompareTo(TESForm& compareTo);
    #ifndef OBLIVION
    _LOCAL /*---/10C*/ virtual bool         DialogMessageCallback(HWND dialog, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& result); 
    _LOCAL /*---/114*/ virtual void         SetInDialog(HWND dialog);
    _LOCAL /*---/118*/ virtual void         GetFromDialog(HWND dialog);
    _LOCAL /*---/11C*/ virtual void         CleanupDialog(HWND dialog);
    #endif

    // constructor
    _LOCAL AffixList();
    
    // COEF ExtendedForm component
    static ExtendedForm         extendedForm; 
    _LOCAL static TESForm*      CreateAffixList(); // creates a blank MyForm

    // CS dialog management
    #ifndef OBLIVION
    static UInt32               kMenuIdentifier;   // identifier for new menu item
    static HWND                 dialogHandle; // handle of dialog if currently open
    _LOCAL static void          OpenDialog(); // opens dialog if it is not currently open
    #endif

    // global initialization function, called once when submodule is first loaded
    _LOCAL static void          InitializeAffixList();

private:
};
